import request from '@/utils/request'

/* 获取企业列表的接口 */
export const fetchEnterpriseListAPI = (pageParams) => {
  return request({
    url: '/park/enterprise',
    method: 'GET',
    params: pageParams
  })
}

/* 删除企业的接口 */
export const deleteEnterpriseAPI = (id) => {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'DELETE'
  })
}

/* 添加企业的接口 */
export const addEnterpriseAPI = (data) => {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}

/* 更新企业的接口 */
export const updateEnterpriseAPI = (data) => {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}

/* 查找企业的接口 */
export const findEnterpriseAPI = (id) => {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}

/* 添加合同的接口 */
export const addContractAPI = (data) => {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

/* 用于上传文件的接口 */
export const uploadAPI = (formData) => {
  return request({
    url: '/upload',
    method: 'POST',
    data: formData
  })
}

/* 获取所在行业列表的接口 */
export const fetchIndustryListAPI = () => {
  return request({
    url: '/park/industry',
    method: 'GET'
  })
}

/* 企业租赁信息列表展开查看的接口 */
export const fetchContractListAPI = (id) => {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'GET'
  })
}

/* 退租的接口 */
export const rentingQutAPI = (id) => {
  return request({
    url: `park/enterprise/rent/${id}`,
    method: 'PUT'
  })
}

/* 删除合同的接口 */
export const deleteContractAPI = (id) => {
  return request({
    url:`/park/enterprise/rent/${id}`,
    method:"DELETE"
  })
}
